<!--
 * @Author: xuyijie
 * @Date: 2022-12-06 08:39:46
 * @LastEditors: xuyijie
 * @LastEditTime: 2022-12-06 10:11:58
 * @Description: 文件说明
-->
<script setup lang="ts">
import useAuth from '@/composables/useAuth'
import { RouteName } from '@/enum/RouteName'
const { isLogin, logout } = useAuth()
</script>

<template>
  <div class="h-screen !w-screen bg-gray-700 flex flex-col justify-center items-center !-mt-0">
    <img src="/images/logoVue.png" class="w-40 h-40 object-cover rounded-full border-8 border-white mb-5" />
    <div>
      <HdFormButton @click="$router.push({ name: 'admin' })" class="danger ml-2"> 访问后台 </HdFormButton>
      <HdFormButton v-if="!isLogin()" class="primary ml-2" @click="$router.push({ name: RouteName.LOGIN })">
        用户登录
      </HdFormButton>
      <HdFormButton v-if="isLogin()" class="bg-orange-600 text-white ml-2" @click="logout"> 退出登录 </HdFormButton>
    </div>
  </div>
</template>
